<?php
class Model_LibraryAcl extends Zend_Acl {
	public function __construct() {
		$this->addRole(new Zend_Acl_Role('guest'));
		$this->addRole(new Zend_Acl_Role('guests'), 'guest');
		$this->addRole(new Zend_Acl_Role('users'), 'guests');
		$this->addRole(new Zend_Acl_Role('admins'), 'users');
		
		
		
		$this->add(new Zend_Acl_Resource('client'))
		->add(new Zend_Acl_Resource('client:index'), 'client');
		
		$this->add(new Zend_Acl_Resource('categorie'))
		->add(new Zend_Acl_Resource('categorie:index'), 'categorie')	 
		->add(new Zend_Acl_Resource('categorie:delete'), 'categorie');	
		
		
		$this->add(new Zend_Acl_Resource('default'))
		->add(new Zend_Acl_Resource('default:connexion'), 'default')
		->add(new Zend_Acl_Resource('default:index'), 'default')
		->add(new Zend_Acl_Resource('default:fiche'), 'default')
		->add(new Zend_Acl_Resource('default:faq'), 'default')
		->add(new Zend_Acl_Resource('default:telechargement'), 'default')
		 ->add(new Zend_Acl_Resource('default:error'), 'default');
		
		
		
		$this->allow('guest', 'default:index', 'index');
		$this->allow('guest', 'default:faq', 'index');
		$this->allow('guest', 'default:telechargement', 'index');
		$this->allow('guest', 'default:fiche', array( 'visiopro','visiohome','visioshop'));
		$this->allow('guest', 'default:error', 'error');
		$this->allow('guest', 'default:connexion', 'index');
		$this->deny('guests', 'default:connexion', 'index');
		$this->allow('guests', 'default:connexion', 'logout');
		$this->allow('guests', 'client:index', array( 'index','direct'));
		
		
		
	}
}
